/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const saleRouter = {
  path: '/views/saleManage',
  component: Layout,
  redirect: 'noRedirect',
  name: 'saleManage',
  meta: {
    title: '销售管理',
    icon: 'sale',
    roles: ['admin', 'user']
  },
  children: [
    {
      path: '/views/saleManage/salesBill',
      component: () => import('@/views/saleManage/salesBill/index'),
      //当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
      redirect: 'noRedirect',
      // alwaysShow: true, //一直显示根路由
      meta: {
        title: '单据',
        roles: ['admin', 'user']
      }, //你可以在根路由设置权限，这样它下面所有的子路由都继承了这个权限
      children: [{
          path: '/views/saleManage/salesBill/billSalesOrder',
          component: () => import('@/views/saleManage/salesBill/billSalesOrder'), // 销售订单
          name: 'billSalesOrder',
          meta: {
            title: '销售订单',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/saleManage/salesBill/billSalesDelivery',
          component: () => import('@/views/saleManage/salesBill/billSalesDelivery'), // 销售出库
          name: 'billSalesDelivery',
          meta: {
            title: '销售出库',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/saleManage/salesBill/billSalesReturn',
          component: () => import('@/views/saleManage/salesBill/billSalesReturn'), // 销售退货
          name: 'billSalesReturn',
          meta: {
            title: '销售退货',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/saleManage/salesBill/billSalesExchange',
          component: () => import('@/views/saleManage/salesBill/billSalesExchange'), // 销售换货
          name: 'billSalesExchange',
          meta: {
            title: '销售换货',
            roles: ['admin', 'user']
          }
        },

      ]
    },
    {
      path: '/views/saleManage/salesRecord',
      component: () => import('@/views/saleManage/salesRecord/index'),
      //当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
      redirect: 'noRedirect',
      // alwaysShow: true, //一直显示根路由
      meta: {
        title: '记录',
        roles: ['admin', 'user']
      }, //你可以在根路由设置权限，这样它下面所有的子路由都继承了这个权限
      children: [{
          path: '/views/saleManage/salesRecord/salesOrder',
          component: () => import('@/views/saleManage/salesRecord/salesOrder'), // 销售订单记录
          name: 'salesOrder',
          meta: {
            title: '销售订单记录',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/saleManage/salesRecord/salesDelivery',
          component: () => import('@/views/saleManage/salesRecord/salesDelivery'), // 销售出库记录
          name: 'salesDelivery',
          meta: {
            title: '销售出库记录',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/saleManage/salesRecord/salesReturn',
          component: () => import('@/views/saleManage/salesRecord/salesReturn'), // 销售退货记录
          name: 'salesReturn',
          meta: {
            title: '销售退货记录',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/saleManage/salesRecord/salesExchange',
          component: () => import('@/views/saleManage/salesRecord/salesExchange'), // 销售换货记录
          name: 'salesExchange',
          meta: {
            title: '销售换货记录',
            roles: ['admin', 'user']
          }
        },

      ]
    },
    {
      path: '/views/reportStatistics/salesReport',
      component: () => import('@/views/reportStatistics/salesReport/index'),
      //当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
      redirect: 'noRedirect',
      // alwaysShow: true, //一直显示根路由
      meta: {
        title: '统计',
        roles: ['admin', 'user']
      }, //你可以在根路由设置权限，这样它下面所有的子路由都继承了这个权限
      children: [{
          path: '/views/reportStatistics/salesReport/salesOrderExecution',
          component: () => import('@/views/reportStatistics/salesReport/salesOrderExecution'),// 销售订单执行情况
          name: 'salesOrderExecution',
          meta: {
            title: '销售订单执行情况',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/salesReport/salesOrderStatistics',
          component: () => import('@/views/reportStatistics/salesReport/salesOrderStatistics'), // 销售订单统计
          name: 'salesOrderStatistics',
          meta: {
            title: '销售订单统计',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/salesReport/salesOrderDetailsQuery',
          component: () => import('@/views/reportStatistics/salesReport/salesOrderDetailsQuery'), // 销售订单明细查询
          name: 'salesOrderDetailsQuery',
          meta: {
            title: '销售订单明细查询',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/salesReport/statisticsByCustomer',
          component: () => import('@/views/reportStatistics/salesReport/statisticsByCustomer'), // 销售统计(按客户)
          name: 'statisticsByCustomer',
          meta: {
            title: '销售统计(按客户)',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/salesReport/salesStatisticsByCommodity',
          component: () => import('@/views/reportStatistics/salesReport/salesStatisticsByCommodity'), // 采购统计(按商品)
          name: 'salesStatisticsByCommodity',
          meta: {
            title: '销售统计(按商品)',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/salesReport/statisticsBySalesman',
          component: () => import('@/views/reportStatistics/salesReport/statisticsBySalesman'), // 采购统计(按经手人)
          name: 'statisticsBySalesman',
          meta: {
            title: '销售统计(按经手人)',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/salesReport/salesDtails',
          component: () => import('@/views/reportStatistics/salesReport/salesDtails'), // 销售明细查询
          name: 'salesDtails',
          meta: {
            title: '销售明细查询',
            roles: ['admin', 'user']
          }
        },
      ]
    },
  ]
}
export default saleRouter
